package com.lm.jsoup.example;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class JsoupFromUrl {
    public static void main(String[] args) {
        try {
            // 从 URL 抓取网页内容
            Document document = Jsoup.connect("https://lsk-ww.cn").get();

            // 输出网页标题
            System.out.println("Title: " + document.title());

            // 输出网页的第一段文字
            System.out.println("First Paragraph: " + document.select("p").first().text());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
